Skip to content

Comments

chore: Simplify TokenListController initialization#7740

Merged
Gudahtt merged 3 commits intomainfrom
simplify-token-list-controller-init
Jan 30, 2026
Merged

chore: Simplify TokenListController initialization#7740
Gudahtt merged 3 commits intomainfrom
simplify-token-list-controller-init

Conversation

@Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jan 27, 2026

Explanation

There was some complexity in handling the order of operations between controller initialization and the event to persist state changes.

To simplify this, the controller has been updated such that it no longer persists state changes until after initialization. This makes the logic easier to follow, and lets us delete an instance variable and a few blocks of code.

The controller will be initialized as part of wallet initialization, so it will not be "constructed but uninitialized" for any significant length of time.

References

Related to changes made in this PR: #7413

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes when TokenListController starts persisting tokensChainsCache and adjusts initialization/storage synchronization logic; regressions could cause missed or unintended StorageService writes/overwrites during startup.

Overview
TokenListController no longer subscribes to stateChange for debounced StorageService persistence until initialize() is called, simplifying construction-time behavior.

Initialization/storage sync logic is simplified by removing the “loaded-from-storage skip” tracking and by scheduling persistence for any chains already present in state at init time. Tests are updated to explicitly call initialize() before asserting persistence, and new cases cover no persistence before init and persisting updates that occurred prior to init.

Written by Cursor Bugbot for commit 6060063. This will update automatically on new commits. Configure here.

@Gudahtt Gudahtt force-pushed the simplify-token-list-controller-init branch from 8bed328 to ca3acb1 Compare January 27, 2026 19:46
@Gudahtt Gudahtt marked this pull request as ready for review January 27, 2026 20:11
@Gudahtt Gudahtt requested a review from a team as a code owner January 27, 2026 20:11
@Gudahtt Gudahtt force-pushed the simplify-token-list-controller-init branch from ca3acb1 to 07a04f4 Compare January 27, 2026 20:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

* data loaded from storage would be immediately written back.
* Chains are removed from this set after being skipped once.
*/
readonly #chainsLoadedFromStorage: Set<Hex> = new Set();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for removing this! That was a workaround to avoid doing redundant writes 🙏

@Gudahtt Gudahtt force-pushed the simplify-token-list-controller-init branch from ad6a0f8 to 11d2a4f Compare January 27, 2026 21:17
sahar-fehri
sahar-fehri previously approved these changes Jan 28, 2026
There was some complexity in handling the order of operations between
controller initialization and the event to persist state changes.

To simplify this, the controller has been updated such that it no
longer persists state changes until _after_ initialization. This
makes the logic easier to follow, and lets us delete an instance
variable and a few blocks of code.

The controller will be initialized as part of wallet initialization, so
it will not be "constructed but uninitialized" for any significant
length of time.
@Gudahtt Gudahtt force-pushed the simplify-token-list-controller-init branch from 11d2a4f to 6060063 Compare January 30, 2026 16:21
@Gudahtt
Copy link
Member Author

Gudahtt commented Jan 30, 2026

Rebased to resolve conflicts

@Gudahtt
Copy link
Member Author

Gudahtt commented Jan 30, 2026

@metamaskbot publish-previews

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "4.0.0-preview-6060063",
  "@metamask-previews/accounts-controller": "35.0.2-preview-6060063",
  "@metamask-previews/address-book-controller": "7.0.1-preview-6060063",
  "@metamask-previews/ai-controllers": "0.0.0-preview-6060063",
  "@metamask-previews/analytics-controller": "1.0.0-preview-6060063",
  "@metamask-previews/analytics-data-regulation-controller": "0.0.0-preview-6060063",
  "@metamask-previews/announcement-controller": "8.0.0-preview-6060063",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-6060063",
  "@metamask-previews/approval-controller": "8.0.0-preview-6060063",
  "@metamask-previews/assets-controller": "0.0.0-preview-6060063",
  "@metamask-previews/assets-controllers": "99.1.0-preview-6060063",
  "@metamask-previews/base-controller": "9.0.0-preview-6060063",
  "@metamask-previews/bridge-controller": "65.1.0-preview-6060063",
  "@metamask-previews/bridge-status-controller": "65.0.1-preview-6060063",
  "@metamask-previews/build-utils": "3.0.4-preview-6060063",
  "@metamask-previews/chain-agnostic-permission": "1.4.0-preview-6060063",
  "@metamask-previews/claims-controller": "0.4.2-preview-6060063",
  "@metamask-previews/composable-controller": "12.0.0-preview-6060063",
  "@metamask-previews/connectivity-controller": "0.1.0-preview-6060063",
  "@metamask-previews/controller-utils": "11.18.0-preview-6060063",
  "@metamask-previews/core-backend": "5.0.0-preview-6060063",
  "@metamask-previews/delegation-controller": "2.0.0-preview-6060063",
  "@metamask-previews/earn-controller": "11.1.0-preview-6060063",
  "@metamask-previews/eip-5792-middleware": "2.1.0-preview-6060063",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-6060063",
  "@metamask-previews/eip1193-permission-middleware": "1.0.3-preview-6060063",
  "@metamask-previews/ens-controller": "19.0.2-preview-6060063",
  "@metamask-previews/error-reporting-service": "3.0.1-preview-6060063",
  "@metamask-previews/eth-block-tracker": "15.0.1-preview-6060063",
  "@metamask-previews/eth-json-rpc-middleware": "23.0.0-preview-6060063",
  "@metamask-previews/eth-json-rpc-provider": "6.0.0-preview-6060063",
  "@metamask-previews/foundryup": "1.0.1-preview-6060063",
  "@metamask-previews/gas-fee-controller": "26.0.2-preview-6060063",
  "@metamask-previews/gator-permissions-controller": "1.1.2-preview-6060063",
  "@metamask-previews/json-rpc-engine": "10.2.1-preview-6060063",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-6060063",
  "@metamask-previews/keyring-controller": "25.1.0-preview-6060063",
  "@metamask-previews/logging-controller": "7.0.1-preview-6060063",
  "@metamask-previews/message-manager": "14.1.0-preview-6060063",
  "@metamask-previews/messenger": "0.3.0-preview-6060063",
  "@metamask-previews/multichain-account-service": "5.1.0-preview-6060063",
  "@metamask-previews/multichain-api-middleware": "1.2.6-preview-6060063",
  "@metamask-previews/multichain-network-controller": "3.0.2-preview-6060063",
  "@metamask-previews/multichain-transactions-controller": "7.0.0-preview-6060063",
  "@metamask-previews/name-controller": "9.0.0-preview-6060063",
  "@metamask-previews/network-controller": "29.0.0-preview-6060063",
  "@metamask-previews/network-enablement-controller": "4.1.0-preview-6060063",
  "@metamask-previews/notification-services-controller": "21.0.0-preview-6060063",
  "@metamask-previews/permission-controller": "12.2.0-preview-6060063",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-6060063",
  "@metamask-previews/perps-controller": "0.0.0-preview-6060063",
  "@metamask-previews/phishing-controller": "16.1.0-preview-6060063",
  "@metamask-previews/polling-controller": "16.0.2-preview-6060063",
  "@metamask-previews/preferences-controller": "22.0.0-preview-6060063",
  "@metamask-previews/profile-metrics-controller": "3.0.0-preview-6060063",
  "@metamask-previews/profile-sync-controller": "27.0.0-preview-6060063",
  "@metamask-previews/ramps-controller": "5.0.0-preview-6060063",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-6060063",
  "@metamask-previews/remote-feature-flag-controller": "4.0.0-preview-6060063",
  "@metamask-previews/sample-controllers": "4.0.2-preview-6060063",
  "@metamask-previews/seedless-onboarding-controller": "7.1.0-preview-6060063",
  "@metamask-previews/selected-network-controller": "26.0.2-preview-6060063",
  "@metamask-previews/shield-controller": "5.0.1-preview-6060063",
  "@metamask-previews/signature-controller": "39.0.1-preview-6060063",
  "@metamask-previews/storage-service": "0.0.1-preview-6060063",
  "@metamask-previews/subscription-controller": "5.4.2-preview-6060063",
  "@metamask-previews/token-search-discovery-controller": "4.0.0-preview-6060063",
  "@metamask-previews/transaction-controller": "62.12.0-preview-6060063",
  "@metamask-previews/transaction-pay-controller": "12.0.2-preview-6060063",
  "@metamask-previews/user-operation-controller": "41.0.2-preview-6060063"
}

@Gudahtt Gudahtt added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 1bb0769 Jan 30, 2026
306 checks passed
@Gudahtt Gudahtt deleted the simplify-token-list-controller-init branch January 30, 2026 17:01
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Feb 11, 2026
…3.18.0 (#39887)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
[skip-e2e]
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR bump `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1`.
The current resolved version in the `yarn.lock` is `99.1.0`, which
includes a change that introduces a bug with Tempo native balances. A
fix has been released in `99.3.1`, so we need to bump to that version to
get the fix.

The cherry-pick into `13.18.0` is necessary as it includes the affected
version of `@metamask/assets-controllers`, and we don't want it to reach
production.

```markdown
## [99.3.1]

### Fixed

- Remove `Tempo Testnet` multicall address ([#7858](MetaMask/core#7858)).

## [99.3.0]

### Added

- Add optional `rwaData` support when adding tokens in `TokensController` ([#7804](MetaMask/core#7804)).

### Changed

- Lock `@metamask/core-backend` to `5.0.0` ([#7852](MetaMask/core#7852))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](MetaMask/core#7849))
- Fix trending tokens showing incorrect market cap values by adding `usePriceApiData` parameter (defaults to `true`) to use price API data for accurate market data ([#7829](MetaMask/core#7829))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.15.0` ([#7832](MetaMask/core#7832), [#7854](MetaMask/core#7854))

## [99.2.0]

### Added

- Add `HYPEREVM` support ([#7790](MetaMask/core#7790))
  - Add `HYPEREVM` in `SupportedTokenDetectionNetworks`
  - Add `HYPEREVM` in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`

### Changed

- Simplify TokenListController initialization ([#7740](MetaMask/core#7740))
- Bump `@metamask/storage-service` from `^0.0.1` to `^1.0.0` ([#7797](MetaMask/core#7797))
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.13.0` ([#7775](MetaMask/core#7775), [#7802](MetaMask/core#7802))
- Bump `@metamask/preferences-controller` from `^22.0.0` to `^22.1.0` ([#7802](MetaMask/core#7802))

### Removed

- Removed token-search-discovery-controller package ([#7789](MetaMask/core#7789))
```

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/39887?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade in a core controllers package can change
token/balance behavior and introduces transitive version shifts; risk is
mitigated by being a targeted bump intended to pick up a bugfix release.
> 
> **Overview**
> Bumps `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1` and
refreshes `yarn.lock` to resolve to `99.3.1`.
> 
> Removes the Yarn patch previously applied to
`@metamask/assets-controllers@93.1.0` (and its patched exchange-rate
precision changes), relying on upstream package fixes instead; lockfile
also reflects updated transitive constraints (e.g., pinning
`@metamask/core-backend` to `5.0.0` and newer controller deps).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7457931. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
runway-github bot added a commit to MetaMask/metamask-extension that referenced this pull request Feb 11, 2026
… cp-13.18.0 (#39887)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
[skip-e2e]
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR bump `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1`.
The current resolved version in the `yarn.lock` is `99.1.0`, which
includes a change that introduces a bug with Tempo native balances. A
fix has been released in `99.3.1`, so we need to bump to that version to
get the fix.

The cherry-pick into `13.18.0` is necessary as it includes the affected
version of `@metamask/assets-controllers`, and we don't want it to reach
production.

```markdown
## [99.3.1]

### Fixed

- Remove `Tempo Testnet` multicall address ([#7858](MetaMask/core#7858)).

## [99.3.0]

### Added

- Add optional `rwaData` support when adding tokens in `TokensController` ([#7804](MetaMask/core#7804)).

### Changed

- Lock `@metamask/core-backend` to `5.0.0` ([#7852](MetaMask/core#7852))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](MetaMask/core#7849))
- Fix trending tokens showing incorrect market cap values by adding `usePriceApiData` parameter (defaults to `true`) to use price API data for accurate market data ([#7829](MetaMask/core#7829))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.15.0` ([#7832](MetaMask/core#7832), [#7854](MetaMask/core#7854))

## [99.2.0]

### Added

- Add `HYPEREVM` support ([#7790](MetaMask/core#7790))
  - Add `HYPEREVM` in `SupportedTokenDetectionNetworks`
  - Add `HYPEREVM` in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`

### Changed

- Simplify TokenListController initialization ([#7740](MetaMask/core#7740))
- Bump `@metamask/storage-service` from `^0.0.1` to `^1.0.0` ([#7797](MetaMask/core#7797))
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.13.0` ([#7775](MetaMask/core#7775), [#7802](MetaMask/core#7802))
- Bump `@metamask/preferences-controller` from `^22.0.0` to `^22.1.0` ([#7802](MetaMask/core#7802))

### Removed

- Removed token-search-discovery-controller package ([#7789](MetaMask/core#7789))
```

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/39887?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade in a core controllers package can change
token/balance behavior and introduces transitive version shifts; risk is
mitigated by being a targeted bump intended to pick up a bugfix release.
> 
> **Overview**
> Bumps `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1` and
refreshes `yarn.lock` to resolve to `99.3.1`.
> 
> Removes the Yarn patch previously applied to
`@metamask/assets-controllers@93.1.0` (and its patched exchange-rate
precision changes), relying on upstream package fixes instead; lockfile
also reflects updated transitive constraints (e.g., pinning
`@metamask/core-backend` to `5.0.0` and newer controller deps).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7457931. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
Prithpal-Sooriya added a commit to MetaMask/metamask-extension that referenced this pull request Feb 11, 2026
…3.18.0 (#39887)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
[skip-e2e]
-->

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR bump `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1`.
The current resolved version in the `yarn.lock` is `99.1.0`, which
includes a change that introduces a bug with Tempo native balances. A
fix has been released in `99.3.1`, so we need to bump to that version to
get the fix.

The cherry-pick into `13.18.0` is necessary as it includes the affected
version of `@metamask/assets-controllers`, and we don't want it to reach
production.

```markdown

- Remove `Tempo Testnet` multicall address ([#7858](MetaMask/core#7858)).

- Add optional `rwaData` support when adding tokens in `TokensController` ([#7804](MetaMask/core#7804)).

- Lock `@metamask/core-backend` to `5.0.0` ([#7852](MetaMask/core#7852))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](MetaMask/core#7849))
- Fix trending tokens showing incorrect market cap values by adding `usePriceApiData` parameter (defaults to `true`) to use price API data for accurate market data ([#7829](MetaMask/core#7829))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.15.0` ([#7832](MetaMask/core#7832), [#7854](MetaMask/core#7854))

- Add `HYPEREVM` support ([#7790](MetaMask/core#7790))
  - Add `HYPEREVM` in `SupportedTokenDetectionNetworks`
  - Add `HYPEREVM` in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`

- Simplify TokenListController initialization ([#7740](MetaMask/core#7740))
- Bump `@metamask/storage-service` from `^0.0.1` to `^1.0.0` ([#7797](MetaMask/core#7797))
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.13.0` ([#7775](MetaMask/core#7775), [#7802](MetaMask/core#7802))
- Bump `@metamask/preferences-controller` from `^22.0.0` to `^22.1.0` ([#7802](MetaMask/core#7802))

- Removed token-search-discovery-controller package ([#7789](MetaMask/core#7789))
```

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/39887?quickstart=1)

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

Fixes:

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade in a core controllers package can change
token/balance behavior and introduces transitive version shifts; risk is
mitigated by being a targeted bump intended to pick up a bugfix release.
>
> **Overview**
> Bumps `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1` and
refreshes `yarn.lock` to resolve to `99.3.1`.
>
> Removes the Yarn patch previously applied to
`@metamask/assets-controllers@93.1.0` (and its patched exchange-rate
precision changes), relying on upstream package fixes instead; lockfile
also reflects updated transitive constraints (e.g., pinning
`@metamask/core-backend` to `5.0.0` and newer controller deps).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7457931. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
github-merge-queue bot pushed a commit to MetaMask/metamask-mobile that referenced this pull request Feb 18, 2026
#25796)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR bump `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1`.
The current resolved version in the `yarn.lock` is `99.1.0`, which
includes a change that introduces a bug with Tempo native balances. A
fix has been released in `99.3.1`, so we need to bump to that version to
get the fix.

```markdown
## [99.3.1]

### Fixed

- Remove `Tempo Testnet` multicall address ([#7858](MetaMask/core#7858)).

## [99.3.0]

### Added

- Add optional `rwaData` support when adding tokens in `TokensController` ([#7804](MetaMask/core#7804)).

### Changed

- Lock `@metamask/core-backend` to `5.0.0` ([#7852](MetaMask/core#7852))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](MetaMask/core#7849))
- Fix trending tokens showing incorrect market cap values by adding `usePriceApiData` parameter (defaults to `true`) to use price API data for accurate market data ([#7829](MetaMask/core#7829))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.15.0` ([#7832](MetaMask/core#7832), [#7854](MetaMask/core#7854))

## [99.2.0]

### Added

- Add `HYPEREVM` support ([#7790](MetaMask/core#7790))
  - Add `HYPEREVM` in `SupportedTokenDetectionNetworks`
  - Add `HYPEREVM` in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`

### Changed

- Simplify TokenListController initialization ([#7740](MetaMask/core#7740))
- Bump `@metamask/storage-service` from `^0.0.1` to `^1.0.0` ([#7797](MetaMask/core#7797))
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.13.0` ([#7775](MetaMask/core#7775), [#7802](MetaMask/core#7802))
- Bump `@metamask/preferences-controller` from `^22.0.0` to `^22.1.0` ([#7802](MetaMask/core#7802))

### Removed

- Removed token-search-discovery-controller package ([#7789](MetaMask/core#7789))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade in core asset/balance controller codepaths could
change token balance fetching behavior at runtime; test changes are low
risk but lockfile churn may mask subtle transitive updates.
> 
> **Overview**
> Updates `@metamask/assets-controllers` to `^99.3.1` and drops the
local Yarn patch previously applied to `99.2.0`, letting the app consume
the upstream fixes (including the Tempo native balance regression noted
in the PR context).
> 
> Cleans up `TokenBalancesController`/`TokenDetectionController`
messenger unit tests by removing locally-declared `RootMessenger`
generic types and reusing the shared `RootMessenger` type from
`app/core/Engine/types`. Lockfile/resolution entries are updated
accordingly to reflect the new dependency graph.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0e1ee10. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
grvgoel81 pushed a commit to MetaMask/metamask-mobile that referenced this pull request Feb 23, 2026
#25796)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR bump `@metamask/assets-controllers` from `^99.0.0` to `^99.3.1`.
The current resolved version in the `yarn.lock` is `99.1.0`, which
includes a change that introduces a bug with Tempo native balances. A
fix has been released in `99.3.1`, so we need to bump to that version to
get the fix.

```markdown
## [99.3.1]

### Fixed

- Remove `Tempo Testnet` multicall address ([#7858](MetaMask/core#7858)).

## [99.3.0]

### Added

- Add optional `rwaData` support when adding tokens in `TokensController` ([#7804](MetaMask/core#7804)).

### Changed

- Lock `@metamask/core-backend` to `5.0.0` ([#7852](MetaMask/core#7852))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](MetaMask/core#7849))
- Fix trending tokens showing incorrect market cap values by adding `usePriceApiData` parameter (defaults to `true`) to use price API data for accurate market data ([#7829](MetaMask/core#7829))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.15.0` ([#7832](MetaMask/core#7832), [#7854](MetaMask/core#7854))

## [99.2.0]

### Added

- Add `HYPEREVM` support ([#7790](MetaMask/core#7790))
  - Add `HYPEREVM` in `SupportedTokenDetectionNetworks`
  - Add `HYPEREVM` in `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`

### Changed

- Simplify TokenListController initialization ([#7740](MetaMask/core#7740))
- Bump `@metamask/storage-service` from `^0.0.1` to `^1.0.0` ([#7797](MetaMask/core#7797))
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.13.0` ([#7775](MetaMask/core#7775), [#7802](MetaMask/core#7802))
- Bump `@metamask/preferences-controller` from `^22.0.0` to `^22.1.0` ([#7802](MetaMask/core#7802))

### Removed

- Removed token-search-discovery-controller package ([#7789](MetaMask/core#7789))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade in core asset/balance controller codepaths could
change token balance fetching behavior at runtime; test changes are low
risk but lockfile churn may mask subtle transitive updates.
> 
> **Overview**
> Updates `@metamask/assets-controllers` to `^99.3.1` and drops the
local Yarn patch previously applied to `99.2.0`, letting the app consume
the upstream fixes (including the Tempo native balance regression noted
in the PR context).
> 
> Cleans up `TokenBalancesController`/`TokenDetectionController`
messenger unit tests by removing locally-declared `RootMessenger`
generic types and reusing the shared `RootMessenger` type from
`app/core/Engine/types`. Lockfile/resolution entries are updated
accordingly to reflect the new dependency graph.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0e1ee10. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants